/*
 * @Description:
 * @Author: wangqi
 * @Date: 2021-05-08 23:00:32
 * @LastEditTime: 2021-06-02 07:39:10
 */

import h from './mysnabbdom/h';
import patch from './mysnabbdom/patch';

let btn = document.querySelector('#btn');
let container = document.querySelector('#container');


let vnode1 = h('h3', { key: "vnode1_h" }, '来了老弟~');
let vnode11 = h('h3', { key: "vnode1_h" }, '来了老弟11~~');

let vnode2 = h('h3', { key: "vnode2_h" }, [h('p', {}, '哈哈哈哈')]);
let vnode21 = h('h3', { key: "vnode2_h" }, [h('p', {}, '嘿嘿嘿')]);

let vnode3 = h('h3', { key: "vnode3_h" }, [h('p', {}, '嘻嘻嘻嘻_:}')]); 
// console.log(vnode1, "vnode") 

let vnode5 = h('ul', {}, [
    h('li', { key: 'A' }, 'A'),
    h('li', { key: 'B' }, 'B'),
    h('li', { key: 'C' }, 'C'),
    // h('li', { key: 'B2' }, 'B-2'),
    // h('li', { key: 'B1' }, 'B-1'),
]);

let vnode6 = h('ul', {}, [
    h('li', { key: 'A' }, 'A'),
    h('li', { key: 'C' }, 'C'),
    h('li', { key: 'B' }, 'B'),
    h('li', { key: 'B2' }, 'B-2'),
    h('li', { key: 'B1' }, 'B-1'),

]);

patch(container, vnode5);
btn.onclick = function () {
    patch(vnode5, vnode6);
}